package com.xidian.zhiancloud.service.exam.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.xidian.zhiancloud.dao.exam.TExamTypeMapper;
import com.xidian.zhiancloud.model.exam.TExamType;
import com.xidian.zhiancloud.service.exam.ITExamTypeService;

/**
 * 试题类别Service业务层处理
 * 
 * @author zhouweitao
 * @date 2021-03-05
 */
@Service
public class TExamTypeServiceImpl implements ITExamTypeService 
{
    @Autowired
    private TExamTypeMapper tExamTypeMapper;

    /**
     * 查询试题类别
     * 
     * @param id 试题类别ID
     * @return 试题类别
     */
    @Override
    public TExamType selectTExamTypeById(Long id)
    {
        return tExamTypeMapper.selectTExamTypeById(id);
    }

    /**
     * 查询试题类别列表
     * 
     * @param tExamType 试题类别
     * @return 试题类别
     */
    @Override
    public Page<TExamType> selectTExamTypeList(TExamType tExamType)
    {
    	PageHelper.startPage(tExamType.getPageNum()-1, tExamType.getPageSize());
    	Page<TExamType> pagedata = tExamTypeMapper.selectTExamTypeList(tExamType);
        return pagedata;
    }

    /**
     * 新增试题类别
     * 
     * @param tExamType 试题类别
     * @return 结果
     */
    @Override
    public int insertTExamType(TExamType tExamType)
    {
        return tExamTypeMapper.insertTExamType(tExamType);
    }

    /**
     * 修改试题类别
     * 
     * @param tExamType 试题类别
     * @return 结果
     */
    @Override
    public int updateTExamType(TExamType tExamType)
    {
        return tExamTypeMapper.updateTExamType(tExamType);
    }

    /**
     * 批量删除试题类别
     * 
     * @param ids 需要删除的试题类别ID
     * @return 结果
     */
    @Override
    public int deleteTExamTypeByIds(Long[] ids)
    {
        return tExamTypeMapper.deleteTExamTypeByIds(ids);
    }

    /**
     * 删除试题类别信息
     * 
     * @param id 试题类别ID
     * @return 结果
     */
    @Override
    public int deleteTExamTypeById(Long id)
    {
        return tExamTypeMapper.deleteTExamTypeById(id);
    }


}
